#ifndef CPP_TOOLS_SK_STORAGE_HPP
#define CPP_TOOLS_SK_STORAGE_HPP

#include "sk_storage/const.hpp"

#include <cstring>
#include <list>
#include <string>
#include <unordered_map>

namespace sk_storage {

class LRUCacheOptions {
public:
  size_t capacity;

  LRUCacheOptions();

  ~LRUCacheOptions() = default;
};

class LRUCache {
public:
  LRUCache(const LRUCacheOptions &opt);

  std::string Get(const std::string &key);

  void Put(const std::string &key, const std::string &value);

  ~LRUCache() = default;

private:
  size_t capacity;
  std::list<CacheItem> lru_cache_;
  std::unordered_map<std::string, std::list<CacheItem>::iterator> hash_;
};

} // namespace sk_storage

#endif